package Thread;
//懒汉法
class Singleton2{
    private static Singleton2 instance2=null;
    public Singleton2 getInstance2(){
        if(instance2==null){
            instance2=new Singleton2();
        }
        return instance2;
    }
    private Singleton2(){};

}
public class Demo18 {
    public static void main(String[] args) {

    }
}
